<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2018-03-12 09:26:34
 * @Description: 三级分销提成记录
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-20 09:04:06
 * @FilePath: /归档/user/2018_03_12_084425_create_distribution_logs.php
 */

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDistributionLogs extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('distribution_logs', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('user_id')->default(0)->comment('用户ID');
            $table->foreignId('son_id')->default(0)->comment('子级ID（下单人）');
            $table->foreignId('sun_id')->default(0)->comment('孙级ID（下单人）');
            $table->foreignId('order_id')->default(0)->comment('订单ID');
            $table->unsignedDecimal('money')->default(0)->comment('金额');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('distribution_logs');
    }
}
